/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import modelo.entidade.Conta;
import modelo.entidade.Usuario;

/**
 *
 * @author Flavio
 */
public class ContaDao {
       private DaoHelper daoHelper; 
    public ContaDao(){
    daoHelper = new DaoHelper();
}
    
    public void inserirConta(Conta conta){
        Connection conn=null;
        PreparedStatement stmt=null;
        try {
            conn=daoHelper.getConnection();
            int index=0;
            stmt = conn.prepareStatement("insert into conta(nome,idUsuario) values(?,?) "); 
            stmt.setString(++index, conta.getNome());
            stmt.setInt(++index, 53);
            stmt.executeUpdate();
        }
         catch (SQLException ex) {
            Logger.getLogger(Usuario.class.getName()).log(Level.SEVERE, null, ex);
        }finally{
            daoHelper.closeFinnaly(stmt,conn);
        }
      
    }
}
